#include <signal.h>
#include <iostream>
#include <cstdio>
#include <unistd.h>
void sigcb(int signo)
{
    std::cout << "----------------------------------" << std::endl;
    std::cout << "更改了signal:" << signo << "的默认处理方式" << std::endl;
    std::cout << "----------------------------------" << std::endl;
}

int main()
{
    signal(SIGINT,sigcb);
    for (int i = 1; i < 32; i++)
    {
        printf("%d\n", i);
        sleep(1);
    }
    return 0;
}